package com.hzdp.web.action;

public abstract class AjaxBaseAction extends BaseAction {

	public static final int STATUS_OK = 200;
	private static final int FAIL = 500;

	protected int status = STATUS_OK;
	protected int type = 1;
	protected String msg;
	
	@Override
	public String execute() {
		logger.debug("in execute..");
		try {
			if (checkParams()) {
				executeJson();
			}
		} catch (Exception e) {
			status = FAIL;
		}
		return SUCCESS;
	}

	abstract protected boolean checkParams();

	abstract protected void executeJson();

	abstract public int getType();

	abstract public int getStatus();
	
	abstract public String getMsg();
}
